package router

import (
	"chat.com/server/http/httphandler"
	"github.com/gin-gonic/gin"
)

func GinInit(router *gin.Engine) {
	//router.LoadHTMLGlob("views/**/*")

	// 用户组
	userRouter := router.Group("/user")
	{
		userRouter.GET("/login", httphandler.Login)
		userRouter.GET("/ws", httphandler.WsPage)

		userRouter.GET("/online", httphandler.Online)
		userRouter.GET("/addSingleFriend", httphandler.AddSingleFriend)
		userRouter.GET("/joinGroup", httphandler.JoinGroup)
		//userRouter.POST("/sendMessage", httphandler.SendMessage)
		//userRouter.POST("/sendMessageAll", httphandler.SendMessageAll)
	}

	// 系统
	systemRouter := router.Group("/system")
	{
		systemRouter.GET("/status", httphandler.Status)
		systemRouter.GET("/list", httphandler.List)
	}

	// home
	homeRouter := router.Group("/home")
	{
		homeRouter.GET("/index", httphandler.Index)
	}

	// router.POST("/user/online", user.Online)
}
